<script id="content" type="text/template">
	<div class="btn-group">
		<a href="<!--helper {'anchor-query-state'()}-->" class="btn btn-default <!--if{http().anchor.query.state}--><!--else-->active<!--/if-->">全部状态</a>
		<a href="<!--helper {'anchor-query-state'('1')}-->" class="btn btn-default <!--if{http().anchor.query.state == '1'}-->active<!--/if-->">正常</a>
		<a href="<!--helper {'anchor-query-state'('0')}-->" class="btn btn-default <!--if{http().anchor.query.state == '0'}-->active<!--/if-->">封禁</a>
	</div>
	<div class="btn-group">
		<a href="<!--helper {'anchor-query-administrator'()}-->" class="btn btn-default <!--if{http().anchor.query.administrator}--><!--else-->active<!--/if-->">全部类型</a>
		<a href="<!--helper {'anchor-query-administrator'('1')}-->" class="btn btn-default <!--if{http().anchor.query.administrator == '1'}-->active<!--/if-->">系统应用</a>
		<a href="<!--helper {'anchor-query-administrator'('0')}-->" class="btn btn-default <!--if{http().anchor.query.administrator == '0'}-->active<!--/if-->">普通应用</a>
	</div>
	<div class="btn-group">
		<a href="<!--helper {'anchor-query-on_off'()}-->" class="btn btn-default <!--if{http().anchor.query.on_off}--><!--else-->active<!--/if-->">全部开关</a>
		<a href="<!--helper {'anchor-query-on_off'('1')}-->" class="btn btn-default <!--if{http().anchor.query.on_off == '1'}-->active<!--/if-->">已开启</a>
		<a href="<!--helper {'anchor-query-on_off'('0')}-->" class="btn btn-default <!--if{http().anchor.query.on_off == '0'}-->active<!--/if-->">已关闭</a>
	</div>
	
	
	<a href="#/administrator/application_add" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> 添加</a>
	<button class="btn btn-danger" type="button" action-button="remove"><span class="glyphicon glyphicon-trash"></span> 删除</button>
	<button class="btn btn-default search" type="button" ><span class="glyphicon glyphicon-filter"></span> 筛选</button>
	<!--if{http().anchor.query.search}--><span class="label label-default">存在筛选</span><!--/if-->
	<hr/>
	<table class="table table-striped">
      <thead>
        <tr>
          <th><input type="checkbox" action-table="checkbox-all"></th>
          <th>#</th>
          <th>
          	<!--if{http().anchor.query.sort == "id_desc"}-->
          	<a href="javascript:;" action-sort="id_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>应用ID</a>
          	<!--elseif{http().anchor.query.sort == "id_asc"}-->
          	<a href="javascript:;" action-sort="id_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>应用ID</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="id_desc">应用ID</a>
          	<!--/if-->
          </th>
          <th>
          	<!--if{http().anchor.query.sort == "name_desc"}-->
          	<a href="javascript:;" action-sort="name_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>应用名称</a>
          	<!--elseif{http().anchor.query.sort == "name_asc"}-->
          	<a href="javascript:;" action-sort="name_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>应用名称</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="name_desc">应用名称</a>
          	<!--/if-->
          </th>
          <th>应用描述</th>
          <th>
          	<!--if{http().anchor.query.sort == "administrator_desc"}-->
          	<a href="javascript:;" action-sort="administrator_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>类型</a>
          	<!--elseif{http().anchor.query.sort == "administrator_asc"}-->
          	<a href="javascript:;" action-sort="administrator_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>类型</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="administrator_desc">类型</a>
          	<!--/if-->
          </th>
          <th>
          	<!--if{http().anchor.query.sort == "on_off_desc"}-->
          	<a href="javascript:;" action-sort="on_off_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>开关</a>
          	<!--elseif{http().anchor.query.sort == "on_off_asc"}-->
          	<a href="javascript:;" action-sort="on_off_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>开关</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="on_off_desc">开关</a>
          	<!--/if-->
          </th>
          <th>
          	<!--if{http().anchor.query.sort == "state_desc"}-->
          	<a href="javascript:;" action-sort="state_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>状态</a>
          	<!--elseif{http().anchor.query.sort == "state_asc"}-->
          	<a href="javascript:;" action-sort="state_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>状态</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="state_desc">状态</a>
          	<!--/if-->
          </th>
          <th>
          	<!--if{http().anchor.query.sort == "update_time_desc"}-->
          	<a href="javascript:;" action-sort="update_time_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>更新时间</a>
          	<!--elseif{http().anchor.query.sort == "update_time_asc"}-->
          	<a href="javascript:;" action-sort="update_time_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>更新时间</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="update_time_desc">更新时间</a>
          	<!--/if-->
          </th>
          
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
      	<!--if{response.list.data.length}-->
      	<!--for{var i in response.list.data}-->
      	<tr>
          <th><input type="checkbox" action-table="checkbox" data-id="<!--{response.list.data[i].application_id}-->"></th>
          <td><!--{parseInt(i)+1+((parseInt(response.list.page_now) - 1) * response.list.page_size)}--></td>
          <th><!--{response.list.data[i].application_id}--></th>
          <td><!--{response.list.data[i].application_name}--></td>
          <td>
          	<div class="tips" data-title="查看简介" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 150px;cursor: pointer;" data="<!--{response.list.data[i].application_info}-->"><!--{response.list.data[i].application_info}--></div>
          </td>
          <td>
          <!--if{parseInt(response.list.data[i].administrator)}-->
          <span class="label label-primary">系统应用</span>
          <!--else-->
          <span class="label label-default">普通应用</span>
          <!--/if-->
          </td>
          
          <td>
          <!--if{parseInt(response.list.data[i].application_on_off)}-->
          <span class="label label-info">已开启</span>
          <!--else-->
          <span class="label label-warning">已关闭</span>
          <!--/if-->
          </td>	
          
          <td>
          <!--if{parseInt(response.list.data[i].application_state)}-->
          <span class="label label-success">正常</span>
          <!--else-->
          <span class="label label-danger">封禁</span>
          <!--/if-->
          </td>
        
          <td><!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.list.data[i].application_update_time) * 1000)}--></td>
          
          <td>
          	<a href="#/administrator/application_edit?id=<!--{response.list.data[i].application_id}-->" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>编辑</a>
          </td>
        </tr>
        <!--/for-->
      	<!--else-->
        <tr>
          <td colspan="10" align="center">无数据</td>
        </tr>
        <!--/if-->
      </tbody>
    </table>
    
    
    
    <!--if{response.list.data.length}-->
	<div class="paging" style="text-align: center;">
		<button class="first btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="1" type="button">首页</button>
		<button class="previous btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="<!--{parseInt(response.list.page_now) - 1}-->" type="button">上一页</button>
		<button class="btn btn-default" type="button">
			第<!--{response.list.page_now}-->页
			/ 共<!--{response.list.page_count}-->页
			/ 有<!--{response.list.row_count}-->条数据</button>
		<button class="next btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{parseInt(response.list.page_now) + 1}-->">下一页</button>
		<button class="end btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{response.list.page_count}-->">尾页</button>
	</div>
	<div class="form-inline" style="text-align: center;margin-top: 10px;">
		<div class="form-group">
			<input type="text" class="form-control paging--value" placeholder="输入跳转页" style="width: 100px;">
		</div>
		<button type="button" class="btn btn-default paging--submit">跳转</button>
	</div>
	<!--/if-->
	
	
	
	
</script>




<script id="search" type="text/template">
	<div style="padding: 10px;width: 500px;">
		<div class="form-group">
		    <label>应用ID：</label>
		    <input type="text" class="form-control" search placeholder="输入要搜索的应用ID" name="application_id" value="<!--{search.application_id}-->">
		</div>
		<div class="form-group">
		    <label>应用名称：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的应用名称" name="application_name" value="<!--{search.application_name}-->">
		</div>
		
		<br/>
		<div class="btn-group" style="width: 100%;">
			<button type="button" class="btn btn-primary" style="width: 50%;" name="search-submit">确定筛选</button>
			<button type="button" class="btn btn-default" style="width: 50%;" name="search-clear">清理筛选</button>
		</div>
	</div>
</script>

